<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>商品页面</title>
</head>
<body>
    <table width="700" border="1">
        <tr>
            <th>商品ID</th>
            <th>商品名</th>
            <th>生产厂家</th>
            <th>类型</th>
            <th>价格</th>
            <th>库存</th>
            <th>操作</th>
        </tr>
        <c:forEach items="${goodsPage.data}" var="goods">
            <tr>
                <td>${goods.goodsId}</td>
                <td>${goods.goodsName}</td>
                <td>${goods.goodsFactory}</td>
                <td>${goods.goodsType}</td>
                <td>${goods.goodsPrice}</td>
                <td>${goods.goodsNum}</td>
                <td>
                    <a href="deleteGoods.do?goodsId=${goods.goodsId}">删除</a>
                </td>
            </tr>
        </c:forEach>
    </table>
    <div id="pageBar">
        <a href="getGoods.do?pageNum=1">首页</a>
        <c:if test="${goodsPage.hasPrev }">
            <a href="getGoods.do?pageNum=${goodsPage.pageNum-1 }">上一页</a>
        </c:if>
        <c:forEach begin="1" end="${goodsPage.totalPages }" var="n">
            <a href="getGoods.do?pageNum=${n }">${n }</a>
        </c:forEach>
        <c:if test="${goodsPage.hasNext }">
            <a href="getGoods.do?pageNum=${goodsPage.pageNum+1 } ">下一页</a>
        </c:if>
        <a href="getGoods.do?pageNum=${goodsPage.totalPages }">尾页</a>
    </div>
</body>
</html>
